﻿using System;
using System.Windows.Forms;
using MassIntellect.WorkIt.Presentation;

namespace MassIntellect.Presentation
{
	public class ActiveElement : IActiveElement
	{
		public bool AllowDrop { get; set; }

		#region События

		public GiveFeedbackEventHandler GiveFeedback { get; set; }
		public DragEventHandler DragDrop { get; set; }
		public DragEventHandler DragEnter { get; set; }
		public EventHandler DragLeave { get; set; }
		public DragEventHandler DragOver { get; set; }
		public MouseEventHandler MouseClick { get; set; }
		public MouseEventHandler MouseDoubleClick { get; set; }
		public MouseEventHandler MouseDown { get; set; }
		public EventHandler MouseEnter { get; set; }
		public EventHandler MouseCaptureChanged { get; set; }
		public EventHandler MouseHover { get; set; }
		public EventHandler MouseLeave { get; set; }
		public MouseEventHandler MouseMove { get; set; }
		public MouseEventHandler MouseUp { get; set; }
		public MouseEventHandler MouseWheel { get; set; }

		public virtual void OnGiveFeedback(GiveFeedbackEventArgs e)
		{
			if (GiveFeedback != null)
				GiveFeedback(this, e);
		}
		public virtual void OnDragDrop(DragEventArgs e)
		{
			if (DragDrop != null)
				DragDrop(this, e);
		}
		public virtual void OnDragEnter(DragEventArgs e)
		{
			if (DragEnter != null)
				DragEnter(this, e);
		}
		public virtual void OnDragLeave()
		{
			if (DragLeave != null)
				DragLeave(this, new EventArgs());
		}
		public virtual void OnDragOver(DragEventArgs e)
		{
			if (DragOver != null)
				DragOver(this, e);
		}
		public virtual void OnMouseClick(MouseEventArgs e)
		{
			if (MouseClick != null)
				MouseClick(this, e);
		}
		public virtual void OnMouseDoubleClick(MouseEventArgs e)
		{
			if (MouseDoubleClick != null)
				MouseDoubleClick(this, e);
		}
		public virtual void OnMouseDown(MouseEventArgs e)
		{
			if (MouseDown != null)
				MouseDown(this, e);
		}
		public virtual void OnMouseCaptureChanged()
		{
			if (MouseCaptureChanged != null)
				MouseCaptureChanged(this, new EventArgs());
		}
		public virtual void OnMouseEnter()
		{
			if (MouseEnter != null)
				MouseEnter(this, new EventArgs());
		}
		public virtual void OnMouseHover()
		{
			if (MouseHover != null)
				MouseHover(this, new EventArgs());
		}
		public virtual void OnMouseLeave()
		{
			if (MouseLeave != null)
				MouseLeave(this, new EventArgs());
		}
		public virtual void OnMouseMove(MouseEventArgs e)
		{
			if (MouseMove != null)
				MouseMove(this, e);
		}
		public virtual void OnMouseUp(MouseEventArgs e)
		{
			if (MouseUp != null)
				MouseUp(this, e);
		}
		public virtual void OnMouseWheel(MouseEventArgs e)
		{
			if (MouseWheel != null)
				MouseWheel(this, e);
		}

		#endregion
	}
}